﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using UnityEngine;

public class FlowVo
{
	//攻击方pos点//
	public int attackPos;
	
	//攻击者状态//
	public int state;

	//被攻击方pos点//
	public int targetPos;

	//技能//
	public string skill;
	
	//攻击类型//
	//0:普通;1:技能//
	public string ackType;
	
	//攻击方式//
	//0:远程;1:进程//
	public string ackMode;
	
	//攻击范围//
	//0:单体;1:群攻//
	public string scope;

	//伤害//
	public List<DamageVo> damageVos = new List<DamageVo> ();

	//主角气势//
	public int mor;
	public int bufferhp;
	public int buffermp;

	//主角buff//
	public string buffer;
	public int doubleHit = 0;

	public FlowVo (string pos, string state,string skill, string ackType, string ackMode, string scope, string targetpos, string mor, string buffer,XmlNodeList damageXml)
	{
		this.attackPos = int.Parse(pos);
		this.state = int.Parse(state);
		this.skill = skill;
		this.ackType = ackType;
		this.ackMode = ackMode;
		this.scope = scope;
		this.targetPos = int.Parse(targetpos);
		this.mor = int.Parse(mor);
		this.buffer = buffer;

		for (int j = 0; j < damageXml.Count; j++) {
			XmlAttributeCollection attributeArr = damageXml [j].Attributes;
			damageVos.Add (new DamageVo (attributeArr ["targetpos"].Value, attributeArr ["damagehp"].Value, attributeArr ["result"].Value,
				attributeArr ["state"].Value,attributeArr ["hp"].Value,attributeArr ["maxhp"].Value,
                attributeArr ["mor"].Value, attributeArr ["buffer"].Value));
		}

	}
}